<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title></title>
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui-mobile/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui-mobile/themes/mobile.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui-mobile/themes/icon.css"/>">


<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui-mobile/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui-mobile/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui-mobile/jquery.easyui.mobile.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/js/showMsg.js"/>"></script>

<script type="text/javascript">

function associationOpenId() {
    $('#saveForm').form('submit', {
        url : '<c:url value='/weixintest/associationOpenId.do'/>', //查询提交路径
        onSubmit : function()//提交按钮相应函数
        {
            return $('#saveForm').form('validate');
        },
        success : function(data) {
            data = eval('(' + data + ')');
            if (data.success) {
                //跳转登录界面                
                window.location.href = "../jsp/weixin/message/successWeixin.jsp";
            } else {
                $.messager.alert("提示", data.msg, 'warning');
            }
        },
        error : function() {
            $.messager.alert("错误", "系统错误，请联系管理员！", 'error');
            return;
        }
    });
    
   /*  $.ajax({
        async : false,
        url : "<c:url value='/weixintest/associationOpenId.do'/>" +"?openId=${openId }&userName"+userName+"&password="+password,
        type : "post",
        success : function(data) {
            if (typeof (data) == 'string' && data != '') {
                data = JSON.parse(data);
                dataReal= data;
            }
           
        
        }
    }); */
}
</script>
</head>



<body>
	<div class="easyui-navpanel">
		<header>
			<div class="m-toolbar">
				<span class="m-title">绑定用户信息</span>
			</div>
		</header>
		<div
			style="margin: 20px auto; width: 100px; height: 100px; border-radius: 100px; overflow: hidden">
			<img
				src="<c:url value="/static/jquery-easyui-mobile/demo-mobile/images/login1.jpg"/>"
				style="margin: 0; width: 100%; height: 100%;">
		</div>
		<form id="saveForm" name="saveForm" method="post">

			<div style="padding: 0 20px">
				<div style="margin-bottom: 10px">
					<input class="easyui-textbox"
						data-options="prompt:'用户名|电话',iconCls:'icon-man'"
						style="width: 100%; height: 38px" id="userName" name="userName">
				</div>
				<div>
					<input class="easyui-passwordbox" data-options="prompt:'密码'"
						style="width: 100%; height: 38px" id="password" name="password">
				</div>
				<div style="text-align: center; margin-top: 30px">
					<a href="###" onclick="associationOpenId()" class="easyui-linkbutton"
						style="width: 100%; height: 40px"><span
						style="font-size: 16px">绑定</span></a>
				</div>
				<!-- <div style="text-align:center;margin-top:30px">
                <a href="#" class="easyui-linkbutton" plain="true" outline="true" style="width:100px;height:35px"><span style="font-size:16px">清空</span></a> 
            </div> -->
				<input class="easyui-validatebox" type="hidden" id="openId"
					name="openId" value='${openId } ' data-options="required:true" />

			</div>
		</form>

	</div>
</body>
</html>